<!--
 * @Author: your name
 * @Date: 2020-11-07 10:50:27
 * @LastEditTime: 2020-11-17 15:10:00
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \cang-chu-guan-li-xi-tong\src\views\chaxunyutongji\ZhuanKuHuiZong.vue
-->
<template>
  <a-card>
    <!-- 搜索栏 -->
    <a-form-model :model="formdata" v-bind="layout">
      <a-row>
        <!-- xxl: 4, xl: 2, lg: 2, md: 1, sm: 1, xs: 1 响应式参照 -->
        <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item label="转出仓库编码">
            <a-select
              placeholder="请选择转出仓库编码"
              v-model="formdata.outWarehousenum"
            >
              <a-select-option
                v-for="val in outWarehousenumlist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item
            ref="outWarehousenanme"
            label="转出仓库名称"
            prop="outWarehousenanme"
          >
            <a-select
              placeholder="请选择转出仓库名称"
              v-model="formdata.outWarehousenanme"
            >
              <a-select-option
                v-for="val in outWarehousenanmelist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
       
        <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item label="转入仓库编码">
            <a-select
              placeholder="请选择转入仓库编码"
              v-model="formdata.inWarehousenum"
            >
              <a-select-option
                v-for="val in inWarehousenumlist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
         <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item
            ref="inWarehousenanme"
            label="转入仓库名称"
            prop="inWarehousenanme"
          >
            <a-select
              placeholder="请选择转入仓库名称"
              v-model="formdata.inWarehousenanme"
            >
              <a-select-option
                v-for="val in inWarehousenanmelist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
      </a-row>
      <!-- <a-row>
        <a-col :lg="7" :md="24" :sm="24">
          <a-form-model-item label="转入仓库编码">
            <a-select
              placeholder="请选择转入仓库编码"
              v-model="formdata.inWarehousenum"
            >
              <a-select-option
                v-for="val in inWarehousenumlist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :lg="7" :md="24" :sm="24">
          <a-form-model-item
            ref="inWarehousenanme"
            label="转入仓库名称"
            prop="inWarehousenanme"
          >
            <a-select
              placeholder="请选择转入仓库名称"
              v-model="formdata.inWarehousenanme"
            >
              <a-select-option
                v-for="val in inWarehousenanmelist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
      </a-row> -->

      <a-row>
        <!-- xxl: 4, xl: 2, lg: 2, md: 1, sm: 1, xs: 1 响应式参照 -->
        <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item label="存货编码">
            <a-select placeholder="请选择编码" v-model="formdata.Stockcode1">
              <a-select-option
                v-for="val in Stockcodelist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
            <!-- <a-col :span="10">
              <a-select placeholder="请选择编码" v-model="formdata.Stockcode1">
                <a-select-option
                  v-for="val in Stockcodelist"
                  :key="val.value"
                  :value="val.value"
                  >{{ val.text }}
                </a-select-option>
              </a-select>
            </a-col>

            <span
              style="
                display: inline-block;
                width: 24px;
                textalign: center;
                margin-top: 4px;
                margin-rigin: 1px;
                margin-left: 6px;
              "
            >
              ~
            </span>

            <a-col :span="10">
              <a-select placeholder="请选择编码" v-model="formdata.Stockcode2">
                <a-select-option
                  v-for="val in Stockcodelist"
                  :key="val.value"
                  :value="val.value"
                  >{{ val.text }}
                </a-select-option>
              </a-select>
            </a-col> -->
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item ref="Stockname" label="存货名称" prop="Stockname">
            <a-select placeholder="存货名称" v-model="formdata.Stockname">
              <a-select-option
                v-for="val in Stocknamelist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
         <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item label="存货分类">
            <a-select
              placeholder="请选择存货分类"
              v-model="formdata.StockClassification"
            >
              <a-select-option
                v-for="val in StockClassificationlist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
          <a-col :md="6" :sm="24">
          <a-form-model-item label="存储单位">
            <a-select
              placeholder="请选择存储单位"
              v-model="formdata.Storageunit"
            >
              <a-select-option
                v-for="(item, index) in StorageunitList"
                :key="index"
                :value="item.value"
                >{{ item.text }}</a-select-option
              >
            </a-select>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item label="存货编码">
            <a-select placeholder="请选择编码" v-model="formdata.Stockcode">
              <a-select-option
                v-for="val in Stockcodelist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
         <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item label="单据状态">
            <a-select placeholder="单据状态" v-model="formdata.DocumentStatus">
              <a-select-option
                v-for="val in DocumentStatuslist"
                :key="val.value"
                :value="val.value"
                >{{ val.text }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item label="签字日期">
            <a-range-picker
              v-model="formdata.signdate"
              @change="signdateChange"
            />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :md="24" :sm="24">
          <a-form-model-item label="会计期间">
            <a-range-picker
              v-model="formdata.Accountingperiod"
              @change="AccountingperiodChange"
            />
          </a-form-model-item>
        </a-col>
      </a-row>

      <a-row>
        <a-col :style="{ textAlign: 'right' }">
          <a-button type="primary" @click="getsearch()">查询</a-button>
          <a-button style="margin-left: 8px" @click="reset()">重置</a-button>
          <a-button style="margin-left: 8px" @click="reset()">导出</a-button>
        </a-col>
      </a-row>
    </a-form-model>
    <!---表格数据--->
    <a-table
      :columns="columns"
      :row-selection="rowSelection"
      :data-source="Transferlist"
      :scroll="{ x: 1500, y: 300 }"
    >
    </a-table>
  </a-card>
</template>
<script>
const columns = [
  {
    title: "行号 ",
    dataIndex: "no",
    key: "0",
    align: "center",
    width: 150,
  },
  {
    title: "签字日期",
    dataIndex: "signdate",
    key: "1",
    align: "center",
    width: 150,
  },
  {
    title: "存货编码",
    dataIndex: "Stockcode",
    key: "2",
    align: "center",
    width: 150,
  },
  {
    title: "存货名称",
    dataIndex: "Stockname",
    key: "3",
    align: "center",
    width: 150,
  },
  {
    title: "分类",
    dataIndex: "classification",
    key: "4",
    align: "center",
    width: 150,
  },
  {
    title: "型号",
    dataIndex: "model",
    key: "5",
    align: "center",
    width: 150,
  },
  {
    title: "规格",
    dataIndex: "Specifications",
    key: "6",
    align: "center",
    width: 150,
  },
  {
    title: "单位",
    dataIndex: "Company",
    key: "7",
    align: "center",
    width: 150,
  },
  {
    title: "辅助单位",
    dataIndex: "Auxiliaryunit",
    key: "8",
    align: "center",
    width: 150,
  },
  {
    title: "单据号",
    dataIndex: "DocumentNo",
    key: "9",
    align: "center",
    width: 150,
  },
  {
    title: "批次号",
    dataIndex: "BatchNumber",
    key: "10",
    align: "center",
    width: 150,
  },
  {
    title: "入库单位",
    dataIndex: "WarehousingUnit",
    key: "11",
    align: "center",
    width: 150,
  },
  {
    title: "入库数量",
    dataIndex: "StorageQuantity",
    key: "12",
    align: "center",
    width: 150,
  },
  {
    title: "出库单位",
    dataIndex: "DeliveryUnit",
    key: "13",
    align: "center",
    width: 150,
  },
  {
    title: "出库数量",
    dataIndex: "DeliveryQuantity",
    key: "14",
    align: "center",
    width: 150,
  },
  {
    title: "结存数量",
    dataIndex: "BalanceQuantity",
    key: "15",
    align: "center",
    width: 150,
  },
  {
    title: "结存单位",
    dataIndex: "BalanceUnit",
    key: "16",
    align: "center",
    width: 150,
  },
  {
    title: "备注",
    dataIndex: "remarks",
    key: "17",
    align: "center",
    width: 150,
  },
];
export default {
  data() {
    return {
      outWarehousenumlist: [], //转出仓库编码字典表
      outWarehousenanmelist: [], //转出仓库名称字典表
      StockClassificationlist: [], //存货分类字典表
      inWarehousenumlist: [], //转入仓库编码字典表
      inWarehousenanmelist: [], //转入仓库名称字典表
      Stockcodelist: [], //存货编码字典表
      Stocknamelist: [], //存货名称字典表
      DocumentStatuslist: [], //单据状态字典表
      selectedRowKeys: [],
      formdata: {
        outWarehousenum: "",
        outWarehousenanme: "",
        StockClassification: "",
        inWarehousenum: "",
        inWarehousenanme: "",
        Stockname: "",
        Stockcode: "",
        Stockcode1: "",
        Stockcode2: "",
        DocumentStatus: "",
        signdate: "",
        Accountingperiod: "",
        Storageunit:"",
      },
      columns,
      Transferlist: [
        //表格数据
        {},
      ],
      layout: {
        labelCol: { span: 8 }, //字
        wrapperCol: { span: 15 }, //框内大小
      },
    };
  },
   computed: {
    rowSelection() {
      const { selectedRowKeys } = this;
      return {
        selectedRowKeys,
        onChange: this.onSelectChange,
        hideDefaultSelections: true,
        selections: [
          {
            key: 'all-data',
            text: '全选',
            onSelect: () => {
              this.selectedRowKeys = [...Array(46).keys()]; // 0...45
            },
          },
          {
            key: 'odd',
            text: '选择奇数行',
            onSelect: changableRowKeys => {
              let newSelectedRowKeys = [];
              newSelectedRowKeys = changableRowKeys.filter((key, index) => {
                if (index % 2 !== 0) {
                  return false;
                }
                return true;
              });
              this.selectedRowKeys = newSelectedRowKeys;
            },
          },
          {
            key: 'even',
            text: '选择偶数行',
            onSelect: changableRowKeys => {
              let newSelectedRowKeys = [];
              newSelectedRowKeys = changableRowKeys.filter((key, index) => {
                if (index % 2 !== 0) {
                  return true;
                }
                return false;
              });
              this.selectedRowKeys = newSelectedRowKeys;
            },
          },
        ],
        onSelection: this.onSelection,
      };
    },
  },
};
</script>
<style lang="less" scoped>
</style>